From 21189b9f7e158fe629b0924bf9ca74d66a5a8d76 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 6 Nov 2014 12:13:08 +0100 Subject: [PATCH] Add gdk_gl_context_has_framebuffer_blit() This checks if the context supports GL_EXT_framebuffer_blit --- gdk/gdkglcontext.c | 11 +++++++++++ gdk/gdkglcontextprivate.h | 15 ++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c index eef707c0b1..b03c82b19c 100644 --- a/gdk/gdkglcontext.c +++ b/gdk/gdkglcontext.c @@ -86,6 +86,7 @@ typedef struct { guint realized : 1; guint use_texture_rectangle : 1; + guint has_gl_framebuffer_blit : 1; GdkGLContextPaintData *paint_data; } GdkGLContextPrivate; @@ -350,6 +351,14 @@ gdk_gl_context_use_texture_rectangle (GdkGLContext *context) return priv->use_texture_rectangle; } +gboolean +gdk_gl_context_has_framebuffer_blit (GdkGLContext *context) +{ + GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context); + + return priv->has_gl_framebuffer_blit; +} + static void gdk_gl_context_realize (GdkGLContext *context) { @@ -359,6 +368,8 @@ gdk_gl_context_realize (GdkGLContext *context) has_npot = epoxy_has_gl_extension ("GL_ARB_texture_non_power_of_two"); has_texture_rectangle = epoxy_has_gl_extension ("GL_ARB_texture_rectangle"); + priv->has_gl_framebuffer_blit = epoxy_has_gl_extension ("GL_EXT_framebuffer_blit"); + if (_gdk_gl_flags & GDK_GL_FLAGS_TEXTURE_RECTANGLE) priv->use_texture_rectangle = TRUE; else if (has_npot) diff --git a/gdk/gdkglcontextprivate.h b/gdk/gdkglcontextprivate.h index ec4ab334a0..8a88242696 100644 --- a/gdk/gdkglcontextprivate.h +++ b/gdk/gdkglcontextprivate.h @@ -49,13 +49,6 @@ struct _GdkGLContextClass cairo_region_t *region); }; -gboolean gdk_gl_context_use_texture_rectangle (GdkGLContext *context); -void gdk_gl_context_end_frame (GdkGLContext *context, - cairo_region_t *painted, - cairo_region_t *damage); - - - typedef struct { guint vertex_array_object; guint tmp_framebuffer; @@ -72,8 +65,12 @@ typedef struct { guint texture_quad_rect_program_map_location; } GdkGLContextPaintData; -GdkGLContextPaintData *gdk_gl_context_get_paint_data (GdkGLContext *context); - +GdkGLContextPaintData *gdk_gl_context_get_paint_data (GdkGLContext *context); +gboolean gdk_gl_context_use_texture_rectangle (GdkGLContext *context); +gboolean gdk_gl_context_has_framebuffer_blit (GdkGLContext *context); +void gdk_gl_context_end_frame (GdkGLContext *context, + cairo_region_t *painted, + cairo_region_t *damage); G_END_DECLS -- 2.30.2